<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<!DOCTYPE html>
<html>
    <head>
    	<title>一笑网-用户主页</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="../../static/layui/css/layui.css" />
        <link rel="stylesheet" href="../../static/css/yx.css" />
        <script src="../../static/js/jquery-2.1.4.min.js" ></script>
        <script type="text/javascript" src="../../static/layui/layui.all.js" ></script>
        <script src="../../static/js/yx.js" >/*公共js*/</script>
        <style type="text/css">
        	.cc{margin: 1em auto;background-color: #FFF;}
        	.c0{min-height: 20rem;}
        	.c1{width: 20rem;float: left;border-right: 1px #CCC solid;}
        	.c2{width: calc(100% - 21rem);float: right;min-height: 40rem;}
        	
        	.user_tx_fox{width: 20rem;float: left;}
        	.user_img{width: 70%;margin: 15%;}
        	.c0{line-height: 1.2em;}
        	
        	/* 功能按钮 */
        	.login-btn{border: 0px #000 solid;color: #666;margin: 1em 1em;}
			.login-btn span{display: inline-block;width: 40%;text-align: center;margin-bottom: 0.5em;}
			.login-btn img{width: 3.5rem;margin-bottom: 0.2em;}
			.login_dt img{width: 3.8rem;margin-left: -5px;}
			.fensi img{width: 3rem;}
			
			/* 右边盒子 */
			.c2{padding: 0.8em 0em;}
			
			.fx1{padding:0em 2em;}
			.fx1 p{line-height: 1.5em;}
			.fx1 a{margin-left: 1em;}
			.fx1 a:hover{color: red;}
			
			.fx2{margin-top: 1em;}
			.yu-head{margin-top: -1em; margin-bottom: 0.5em; text-indent: 1em;}
			.fx2 a{display: inline-block; width: 90%;padding: 0.1em 2em;color: #666;}
			.p_time{float: right;margin-right: 1em;}
			
			.fx7{padding: 2em;}
			.fx7 input{height: 2em;max-width: 20rem;margin: 5px 0px;}
			
        	
        	
        </style>
        <script>
        	
        	//积分详情
        	var jfxs=function(){
        		var str="积分代表一个账号在一笑网的活跃程度，不同的积分可获得相应不同的头衔，你可以通过以下途径获得积分：<br/>"+
        			"帖子发表 +10<br/>"+
        			"评论发表 +3<br/>"+
        			"签到 +20<br/>";
        		layer.alert(str);
        	}
        	//活跃值详情
        	var hyzxs=function(){
        		var str="为防止个别账号大量灌水帖，一笑网v2.0特加入可活跃度机制，你将在以下：<br/>"+
        			"帖子发表 -10<br/>"+
        			"评论发表 -3<br/>"+
        			"签到 +100以上(根据头衔等级恢复到相应值)<br/>";
        		layer.alert(str);
        	}
        	
        	
        	$(function(){
        		
        		if("${is_null}"=="true"){
        			return $('body').html('该用户不存在或已被XXX');
        		}
        		
        		//本页数据
        		var uid="${usee.uid}";	//展示的uid
        		var login_uid="${login_usee.uid}";	//当前登录uid
        		var way="${way}";
        		
        		//主人视角解封按钮
        		if(uid!=login_uid){
        			$('.zhuren').hide();
        		}
        		
        		//对应盒子
        		try{
        			var yu_head=$(".login-btn span").get(way-1).innerText;
        			$(".yu-head").text(yu_head);
        			$(".fx"+way).show();
        		}catch(e){
        		}
        		
        		var sex="${usee.sex}";	//性别
        		//男女有别
		  		if(sex=="男"){
		  			$(".usex").css("color","blue").html("&#xe662;");
		  		}else if(sex=="女"){
		  			$(".usex").css("color","red").html("&#xe661;");
		  		}
        		
        		
        		//签到
        		$(".sign").click(function(){
        			
        			$.post2("doSign.ajax","",function(data){
        				if(data.res==1){
        					layer.msg("签到成功！");
        					setTimeout(function(){
        						location.reload();
        					},800)
        				}
        				if(data.res==0){return layer.msg("签到失败！")}
        				if(data.res==-1){return layer.msg("今天已经签到啦！")}
        				
        			},function(e,ee,eee){
        				layer.alert("异常："+eee);
        			})
        			
        		})
        		
        		//关注
        		$("#guanzhu").click(function(){
        			
        			$.post2("do_hy_user.ajax",{uid:uid},function(data){
        				if(data.res==-9){
        					return layer.msg("未登录！");
        				}
        				if(data.res==1){
        					layer.msg("操作成功！");
        					setInterval(function(){
        						location.reload();
        					},500)
        				}else{
        					layer.msg("操作失败！")
        				}
        				
        			},function(e,ee,eee){
        				layer.alert("异常："+eee);
        			})
        			
        		})
        		
        		//查找好友
        		$(".chazhaousee").click(function(){
        			layer.prompt({title: '输入对方账号id', formType: 0}, function(pass, index){
						layer.close(index);
						setTimeout(function(){
							window.open("rus.html?uid="+pass);
						},500)
					});			
        			return false;
        		})
        		
        		
        	})
        </script>
    </head>
    <body class="rus-html">
    	<div class="aa"> 
    		<%@include file="../in/in_head.jsp"%> <!-- 头部导入 -->
    	</div>
    	
    	<!-- 身体部分 -->
    	<div class="cc yx-max-width">
    		
    		<!-- 头部，基本资料部分 -->
    		<div class="c0">
    			<div class="user_tx_fox">
    				<img class="user_img" src="../../static/tu/${usee.uid}/tou.png" onload="this.style.height=this.offsetWidth+'px'" />
    			</div>
    			
    			<br /><br />
    			<span>ID：${usee.uid}</span>
    			<i class="usex layui-icon"></i></span>
    			
    			<button id="guanzhu" class="layui-btn layui-btn-xs ${gx=='关注'?'yx-bg-one':'layui-btn-primary'}" 
    				style="margin-left: 1em;${isshow==false?'display: none;':''}">
					${gx}
				</button>
    			
    			<br /><br />
    			<span class="yx-color-one">
    				<big>${usee.uname}</big>
    			</span>
    			<span style="margin-left: 0.5em;position: relative;top: -3px;" class="layui-badge layui-bg-blue usee_tx">${usee.ujf}</span>
    			
    			<br /><br />
    			<span style="padding-left: 1em;">${usee.uxy}</span>
    			
    		</div>
    		
    		<div class="c1 yx-phone-max">
    			<div class="login-btn yx-hover-zi-red">
					<span class="info" onclick="location.href='rus.html'">
						<img src="../../static/img/user_btn/btn_info.png"/><br />资料
					</span>
					<span class="fa_post" onclick="location.href='rus.html?uid=${usee.uid}&way=2'">
						<img src="../../static/img/user_btn/btn_fatie.png"/><br />最近发帖
					</span>
					<span class="login_dt zhuren" onclick="window.open('us_foryx.html?way=1')">
						<img src="../../static/img/user_btn/btn_guanzhu.png"/><br />关注
					</span>
					<span class="fensi zhuren" onclick="window.open('us_foryx.html?way=2')">
						<img src="../../static/img/user_btn/fensi.png"/><br />粉丝
					</span>
					<span class="login_dt zhuren" onclick="window.open('../post/us_forposts.html?uid=${usee.uid}&way=3')">
						<img src="../../static/img/user_btn/btn_dongtai.png"/><br />动态
					</span>
					<span class="zhuren" onclick="window.open('../post/us_forposts.html?uid=${usee.uid}&way=2')">
						<img src="../../static/img/user_btn/btn_shoucang.png"/><br />收藏
					</span>
					<span class="zhuren" onclick="location.href='us_upinfo.html'">
						<img src="../../static/img/user_btn/info_xiu.png"/><br />资料修改
					</span>
					<span class="zhuren" onclick="layer.alert('暂未开放...')">
						<img src="../../static/img/user_btn/yb.png"/><br />Y币
					</span>
				</div>
    		</div>
    		
    		<div class="c2 yx-phone-max">
    			<h3 class="yu-head yx-color-one">推荐标题</h3>
    			
    			<div class="fx1 yx-hide">
    				<p>发帖：${uda.fatie}</p>
    				<p>回帖：${uda.huitie}</p>
    				<p>收藏：${uda.post_fw}</p>
    				<p>关注：${uda.user_fw}</p>
    				<p>粉丝：${uda.user_fs}</p>
    				<p>积分：${usee.ujf}<a href="javascript:jfxs();">详</a></p>
    				<c:if test="${login_usee.uid==usee.uid}">
    					<hr style="margin: 5px 0em;"/>
						<p>Y 币：${usee.uyb}</p>
	    				<p>活跃值：${usee.uhuoyue} 
	    					<a href="javascript:hyzxs();">详</a>
	    					<a href="javascript:;" class="sign">${usee.isSign()?"已签到":"签到"}</a>
	    				</p>
	    				<p>未读消息：${uda.wdnews} <a href="us_foryx.html?way=4">详</a></p>
	    				<p>绑定邮箱：${usee.uemail} <a href="us_phone.jsp">详</a></p>
	    				<p>绑定手机号：${usee.uphone} <a href="us_phone.jsp">详</a></p>
	    				<br />
	    				<span style="color: #666;">水平线以下资料不会被其它账号看到</span>
	    				<a href="#" class="chazhaousee" style="margin-left: 2em;">查找好友</a>
	    				<a href="us_foryx.html?way=3" target="_blank" style="margin-left: 2em;">查看积分记录</a>
					</c:if>
    			</div>
    			
    			
    			<!-- 段子推荐 -->
				<div class="fx2 yx-hide">
					
					<c:forEach items="${fa_post}" var="fp" >
						<a href="../post/rpt.html?pid=${fp.pid}" target="_blank" class="yx-hover-red yx-oneline">
							${fp.p_hh}
							<span class="p_time">${fp.p_time}</span>
						</a>
					</c:forEach>
					<br /><br />
					<a href="../post/us_forposts.html?uid=${usee.uid}&way=1" target="_blank"
						 class="yx-color-three yx-hover-red"><i class="layui-icon">&#xe756;</i> 更多数据</a><br /><br />
				</div>
    			
    			
    		</div>
    		
    		
    		<div style="clear: both;"></div>
    		
    	</div>
    	
    	<!-- 页面底部 版权部分 -->
    	<div class="ff">
    		<%@include file="../in/in_bottom.jsp"%> <!-- 底部导入 -->
    	</div>
    	
    	
 	</body>
</html>